package org.example.view;

import org.example.view.Frame.*;

import javax.swing.*;
import java.awt.*;

public class MainPanel extends JPanel {
    /**
     * 内容面板
     */
    private Container contentP;
    /**
     * 主页
     */
    private MainAtm mainAtm;
    /**
     * 菜单选择页面
     */
    private ChooseAtm chooseAtm;
    /**
     * 登录页面
     */
    private LoginAtm loginAtm;
    /**
     * 查询页面
     */
    private FindAtm findAtm;
    /**
     * 取款页面
     */
    private GetAtm getAtm;
    /**
     * 存款页面
     */
    private SaveAtm saveAtm;
    /**
     * 修改密码页面
     */
    private ModifyAtm modifyAtm;
    /**
     * 注册页面
     */
    private RegisterAtm registerAtm;

    public MainPanel() {
        this.addContent();
    }

    private void addContent() {
        this.mainAtm = new MainAtm(this);
        this.loginAtm = new LoginAtm(this);
        this.chooseAtm = new ChooseAtm(this);
        this.modifyAtm = new ModifyAtm(this);
        this.findAtm = new FindAtm(this);
        this.saveAtm = new SaveAtm(this);
        this.getAtm = new GetAtm(this);
        this.registerAtm = new RegisterAtm(this);

        this.setLayout(new CardLayout());

        this.mainAtm.setSize(1024, 768);
        this.add("main", this.mainAtm);//主页
        this.add("login", this.loginAtm);//登录页面
        this.add("choose", this.chooseAtm);//菜单选择页面
        this.add("modify",this.modifyAtm);//修改密码页面
        this.add("find",this.findAtm);//查询余额页面
        this.add("save",this.saveAtm);//存款页面
        this.add("get",this.getAtm);//取款页面
        this.add("register",this.registerAtm);//注册页面
    }

    public Container getContentP() {
        return contentP;
    }

    public void setContentP(Container contentP) {
        this.contentP = contentP;
    }

    public MainAtm getMainAtm() {
        return mainAtm;
    }

    public void setMainAtm(MainAtm mainAtm) {
        this.mainAtm = mainAtm;
    }

    public ChooseAtm getChooseAtm() {
        return chooseAtm;
    }

    public void setChooseAtm(ChooseAtm chooseAtm) {
        this.chooseAtm = chooseAtm;
    }

    public LoginAtm getLoginAtm() {
        return loginAtm;
    }

    public void setLoginAtm(LoginAtm loginAtm) {
        this.loginAtm = loginAtm;
    }

    public FindAtm getFindAtm() {
        return findAtm;
    }

    public void setFindAtm(FindAtm findAtm) {
        this.findAtm = findAtm;
    }

    public GetAtm getGetAtm() {
        return getAtm;
    }

    public void setGetAtm(GetAtm getAtm) {
        this.getAtm = getAtm;
    }

    public SaveAtm getSaveAtm() {
        return saveAtm;
    }

    public void setSaveAtm(SaveAtm saveAtm) {
        this.saveAtm = saveAtm;
    }

    public ModifyAtm getModifyAtm() {
        return modifyAtm;
    }

    public void setModifyAtm(ModifyAtm modifyAtm) {
        this.modifyAtm = modifyAtm;
    }

    public RegisterAtm getRegisterAtm() {
        return registerAtm;
    }

    public void setRegisterAtm(RegisterAtm registerAtm) {
        this.registerAtm = registerAtm;
    }
}
